import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import 'element-plus/dist/index.css';
import '/@/theme/index.scss';
import { store, key } from './store';
import { directive } from '/@/utils/directive';
import { i18n } from '/@/i18n';
import other from '/@/utils/other';
import './assets/scss/app.scss'
import './assets/scss/element-var.scss'
import ElementPlus from 'element-plus';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import VXETable from 'vxe-table'
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'


VXETable.use(VXETablePluginExportXLSX)
import 'vxe-table/lib/style.css'
//import VueGridLayout from 'vue-grid-layout';
import {getUpFileUrl, handleTree, selectDictLabel} from "/@/utils/gfast";
import {useDict} from "/@/api/system/dict/data";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 分页组件
import pagination from '/@/components/pagination/index.vue'
import nodeWrap from '/@/views/linkoo/templates/components/nodeWrap.vue'
import addNode from '/@/views/linkoo/templates/components/addNode.vue'
import mitt from "mitt"
// @ts-ignore
import print from 'vue3-print-nb'
const app = createApp(App);
app.config.globalProperties.$bus = mitt();
app.component('nodeWrap', nodeWrap); //初始化组件
app.component('addNode', addNode); //初始化组件
import {hasPermi} from '/@/directive/hasPermi'
import sxmBarcode from '/@/components/barcodeset/barcodeset.vue'
import VueBarcode from 'vue3-barcode' 
import QrcodeVue from 'qrcode.vue'
import formula from "/@/components/formula/formula.vue"
app.directive('hasPermi', {
    mounted(el,a) {
        hasPermi(el, a)
    }
  })
directive(app);
other.elSvg(app);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.component('sxmbarcode', sxmBarcode);
app.component('QrcodeVue', QrcodeVue);
app.component('barcode', VueBarcode);
app.component('pagination', pagination)
app.component('formula', formula)
app.use(router)
    .use(store, key)
    .use(ElementPlus, { locale:zhCn })
    .use(VXETable)
    .use(print)
    .use(i18n)
    .mount('#app');


// 全局挂载
app.config.globalProperties.getUpFileUrl=getUpFileUrl
app.config.globalProperties.handleTree=handleTree
app.config.globalProperties.useDict=useDict
app.config.globalProperties.selectDictLabel=selectDictLabel
app.config.globalProperties.mittBus = mitt();
